<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script th:src="@{/js/jquery-3.4.1.js}"></script>
</head>

<body>
<div>
  <table id="copyText">
    123456
  </table>
</div>
</body>

<script>
    $(function (){
        getdata()
    })
    function getdata(){

    }
</script>
</html>